<?php
namespace app\qian\controller;

use think\Controller;
use app\qian\model\GmModel as GmModels;
use think\Db;

class Fm extends Controller
{
    private $cModel;   //当前控制器关联模型

    public function _initialize()
    {
        parent::_initialize();
        $this->cModel = new GmModels;   //别名：避免与控制名冲突
    }

    public function index()
    {
        if($this->request->isPost()){
            ECHO 1 ;
        }else{
            $dataList=Db::table('dy_ng')->select();
            $this->assign('dataList', $dataList);
            $nam = Db::table('dy_news')->paginate('3', false, page_param());
            $this->assign('nam', $nam);
            return view('xinwenzixun');
        }
    }
    public function sex()
    {
        if($this->request->isPost()){
            ECHO 1 ;
        }else{
            $data=$_GET['id'];
            $nam = Db::table('dy_news')->select($data);

            $this->assign('nam', $nam);
            return view('sex');
        }
    }


}